<template>
	<div>
		<el-card class="box-card" style="margin-top:15px">
			<div slot="header" class="clearfix">
				<span style="font-weight: bold">设置</span>
			</div>
			<el-row :gutter="15">
				<el-form label-width="80px">
					<el-col :span="12" style="height:62px;">
						<el-form-item label="给药途径">
							<el-input v-model="checkName"  :readonly="true"  size="mini" style="width:150px;"></el-input>
							<el-button type="primary" size="mini" @click="openSelect">选择</el-button>
							<el-button type="primary" size="mini" @click="clearFun">清除</el-button>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="开关标记">
							<el-select v-model="submit.use_flag" placeholder="请选择开关标记">
								<el-option
								  v-for="item in kgbjOptions"
								  :key="item.value"
								  :label="item.label"
								  :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>	
					</el-col>
					<el-col :span="12">
						<el-form-item label="警示级别">
							<el-select v-model="submit.slCode" placeholder="请选择警示级别">
								<el-option
								  v-for="item in jsjbOptions"
								  :key="item.value"
								  :label="item.label"
								  :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>	
					</el-col>
				</el-form>
			</el-row>
		</el-card>
	</div>
</template>

<script>
	export default {
		name:"gytjSetCard",
		data () {
			return {
				checkName:"",
				kgbjOptions:[
					{
					  value: '0',
					  label: '不能使用'
					},
					{
					  value: '1',
					  label: '只能使用'
					},
				],
				jsjbOptions:[
					{
					  value: '0',
					  label: '拦截'
					},
					{
					  value: '1',
					  label: '禁忌'
					},
					{
					  value: '2',
					  label: '不推荐'
					},
					{
					  value: '3',
					  label: '轻微'
					},
				],
				submit:{
					slCode:"0",
					use_flag:"1",
					route_code_encode:""
				}
			}
		},
		props:{
			gytjData:{
				type:Object
			}
		},
		watch:{
			gytjData(val){
				this.checkName=val.name;
				this.submit.route_code_encode=val.id
			},
		},
		methods:{
			clearFun(){
				this.checkName="";
				this.submit.route_code_encode="";
			},
			openSelect () {
				this.$emit("selectPop","给药途径",this.submit.route_code_encode);
			},
			resetFun(){
				this.checkName="";
				this.submit={
					slCode:"0",
					use_flag:"1",
					route_code_encode:""
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.el-card {
		margin-left: 3px;
	}
	.dialogFirstRow>>>.el-input {
		width: 70px;
		margin-right: 10px;
	}
	
	.el-form-item.s_selectbox>>>.el-form-item__content {
		width: 80%;
	}
	
	
	.demo-form-inline>>>.el-form-item {
		margin-bottom: 0px;
	}
	
	.dialogFirstRow>>>label {
		height:41px;
		display:inline-block;
	}
</style>